<!-- Created by henian.xu on 2018/12/13. -->

<template>
    <i
        v-if="unicode"
        class="icon"
        v-html="unicode"
        :style="styles"/>
</template>

<script>
export default {
    name: 'Icon',
    data() {
        return {};
    },
    props: {
        unicode: {
            type: String,
            default: '',
        },
        size: {
            type: [Number, String],
            default: '',
        },
    },
    computed: {
        styles() {
            const { size } = this;
            return {
                fontSize: +size ? `${size}px` : size,
            };
        },
    },
};
</script>

<style lang="scss">
.icon {
    @include make-icon;
}
</style>
